let app = getApp()
Page({

    /**
     * 页面的初始数据
     */
    data: {
        page:1,
        currentTab:1,
        dotation:false,
        status_index:0,
    
      
    },  

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        let that = this;
        var id = options.id;
        this.getCustomer(id);
        that.setData({
            platform:app.globalData.platform,    
            id:id,
            width:app.globalData.windowWidth,
            height:app.globalData.windowHeight,
            statusBarHeight:app.globalData.statusBarHeight,
            navHeight:app.globalData.navHeight,
            marginTop:app.globalData.navTitleTop,
            domain:app.globalData.domain,
            uploadUrl:app.globalData.uploadUrl,
          })
    },
    goBack(){
        console.log('go back')
        wx.navigateBack(-1)
      },
      getCustomer(id){
        let that = this;
        var userInfo=wx.getStorageSync('userInfo');
        
       wx.request({
         headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
         data: {
           user_id:userInfo.id,
           mobile:userInfo.phone,
           id:id
           //phone:userInfo.phone
         
             
         },
         //method: 'POST',
         dataType: 'json',
         timeout: 30000,
         url: app.globalData.domain + 'customer/getCustomer',
         success: (res) => {
     
         let data = res.data;
         
         console.log(data);
           that.setData({
             customer:data.customer,
          
           })
         }
       
        })
      },
      goto:function(e){
        console.log(e);
        var url = e.currentTarget.dataset.url;
        var index = e.currentTarget.dataset.index;     
        app.goto(url,index)
     
        console.log(url);
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {

    }
})